# -*- coding: utf-8 -*-

import appuifw
import e32
import lightblue
import sensor

sens = sensor.sensors()['AccSensor']
sock = lightblue.socket()
sockinfo = lightblue.selectservice() 
sock.connect((sockinfo[0], sockinfo[1]))

def printout(value):       
    delta = []    
    for key in ['data_1', 'data_2', 'data_3']:
         val = value[key]                
         delta.append(val)    
    sock.send("%+.2f*%+.2f*%+.2f#"%(delta[0],delta[1],delta[2]))


s=sensor.Sensor(sens['id'], sens['category']) 
s.connect(printout)        

       


    


                                                     
